<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html> 
    <head lang="en"> 
        <meta charset="UTF-8"> 
        <title>上传注册</title> 
        <link rel="stylesheet" type="text/css" href="../../js/jquery/themes/default/easyui.css">
        <link rel="stylesheet" type="text/css" href="../../js/jquery/themes/icon.css">
        <link rel="stylesheet" type="text/css" href="../../css/demo.css">        
        <script type="text/javascript" src="../../js/jquery/jquery.min.js"></script>
        <script type="text/javascript" src="../../js/jquery/jquery.easyui.min.js"></script>    
        <script>
            $(function() {
                $("#upload").click(function() {
                    $("#fm-upload").form('submit', {
                        type: "post", //提交方式    
                        dataType: 'json',
                        url: "../../util/UploadExcelFile", //请求url
                        onSubmit: function(param) {                           
                            var v = $('#file1').textbox('getValue');
                            if (v === null || v === "") {
                                $.messager.alert({title: '提示',
                                    msg: '请选择一个文件后再上传',
                                    icon: 'info',
                                });
                                return false;
                            }
                        },
                        success: function(data) { //提交成功的回调函数   
                            var data = eval('(' + data + ')');
                            $.messager.alert({title: '提示',
                                msg: data.name + data.msg,
                                icon: 'info',
                            });                         
                        },
                        error: function() {
                            alert("上传失败！");
                           
                        }
                    });
                });

            });
        </script>
    </head> 
    <body> 


        <h2>上传</h2>
        <p>上传江苏科技大学平时成绩记录表，上传完后可以使用用户名工号，密码工号登陆</p>
        <p>登陆后请及时修改密码！！！</p>
        <div style="margin:20px 0;"></div>
        <div class="easyui-panel" title="上传Excel文件" style="width:400px;padding:30px 70px 50px 70px">
            <form id="fm-upload" method="post" enctype="multipart/form-data">
                <div style="margin-bottom:20px">
                    <div>文件1:</div>
                    <input class="easyui-filebox" id = "file1" name="file1" data-options="prompt:'Choose a file...'" style="width:100%">
                </div>
            </form>
            <div>
                <a href="#" class="easyui-linkbutton" id="upload" style="width:100%">Upload</a>
            </div>
        </div>
    </body> 
</html>
